import java.util.Scanner;
public class Main1289 {
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        long i=sc.nextLong();
        System.out.println(demToHex(i));

    }
    private static String demToHex(long i) {
        StringBuffer Hex=new StringBuffer("");
        String m="0123456789ABCDEF";
        if(i==0) Hex.append(i);
        while (i!=0) {
            Hex.append(m.charAt((int) (i%16)));
            i>>=4;
        }
        return Hex.reverse().toString();

    }
}
